
from django.conf.urls.defaults import *
from dolist.apps.tip.models import *
from django.views.generic.list_detail import object_list
from django.contrib.auth.models import User
from django.contrib.syndication.views import feed
import apps.tip.views as views
import apps.tip.feeds as feeds



#from views import bookmarks, popular, snippets
# Info for feeds.
feed_dict = {
    'author': feeds.TipsByAuthorFeed,
    'latest':feeds.LatestTipsFeed,
    'tag': feeds.TipsByTagFeed,
    }
    
info_dict = {
    'queryset': Tip.objects.order_by("-due_time"),
}
user_dict={
    'queryset': User.objects.all(),
}
tag_dict={
'queryset':Tip.objects.select_related(),
}

urlpatterns = patterns('',
    # Example:
    ##    (r'^dolist/', include('dolist.foo.urls')),
    (r'index/','dolist.apps.tip.views.index'),
     # Uncomment this for admin:
    (r'^admin/', include('django.contrib.admin.urls')),
    (r'^accounts/', include('dolist.registration.urls')),
    (r'^images/(?P<path>.*)$', 'django.views.static.serve', {'document_root': 'images'}),
    (r'^css/(?P<path>.*)$', 'django.views.static.serve', {'document_root': 'css'}),
    (r'^js/(?P<path>.*)$', 'django.views.static.serve', {'document_root': 'js'}),
    (r'^pad/(?P<name>\S+)/$',views.notes_index),
    (r'^mytips/$',views.mytips),
    (r'^mytips/tag/(?P<slug>\S+)/$',views.mytips_tag),
    (r'^mytips/tag/$',object_list,tag_dict),
    (r'^mytips/todo/$',views.mytips_todo),
    (r'^mytips/done/$',views.mytips_done),
    (r'^ajax/tip/(?P<tip_id>\d+)/$',views.ajaxhello),
    (r'^html/(?P<path>.*)$', 'django.views.static.serve', {'document_root': 'html'}),

    (r'^users/$',object_list,user_dict ),
    (r'^add/$', views.add_tip),
    (r'^edit/(?P<tip_id>\d+)/$', views.edit_tip),
    (r'^del/(?P<tip_id>\d+)/$', views.del_tip),
    (r'^test/$',views.test),
    (r'^feeds/(?P<key>\w+)/(?P<url>.*)/$',views.authfeed,{'feed_dict': feed_dict}),
    (r'^', include('django.contrib.flatpages.urls')),
    
)
